<!DOCTYPE >
<html lang="zh-cn">
<head>
		<title>后台管理-功能</title>
    <% include ../partials/head %>
    <script src="/js/admin/recommendUser.js"></script>

</head>
<body>
	<header>
    <% include ../partials/header %>
  </header>
  <div class="ch-container">
    <div class="row">
      <% include ../partials/sidebar %>
      <!-- 页面内容 -->
      <div id="content" class="col-lg-10 col-sm-10">
        <div class="row">
          <ul class="breadcrumb">
            <li>
                <a href="/admin/recommendUser">推荐用户管理</a>
            </li>
            <li>
                <a href="">编辑</a>
            </li>
          </ul>
        </div>

        <% if (typeof errMsg != "undefined") { %>
        <div class="alert alert-danger">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong><%= errMsg %></strong>
        </div>
        <% } %>

        <div class="row">
          <div class="box col-md-12">
            <div class="box-inner">
              <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> 编辑推荐用户 </h2>
              </div>

              <div class="box-content">

                <form role="form" method="post" enctype="multipart/form-data" action="/admin/recommendUser/edit" id="recommendUserForm">

                  <div class="form-group">
                      <label >用户介绍:</label>
                      <textarea rows="5" name="intro" class="form-control" id="introText" placeholder="输入用户介绍"> <%= recommendUser.get("intro") %> </textarea>
                  </div>

                  <div class="form-group">
                    <label >所属文章:</label>
                    <select id="articleSelector" name="articleId" >
                        <% if (typeof articles != "undefined") { %>
                          <% articles.forEach(function(article) { %>
                          <option value="<%= article.id %>" <% if (recommendUser && recommendUser.get("article") && article.id === recommendUser.get("article").id) { %> selected="selected" <% } %> >  <%= article.get("title") %></option>
                          <% }) %>
                        <% } %>
                    </select>
                  </div>

                  <div class="form-group">
                    <label >用户:</label>
                    <span><%=recommendUser.get("user").get("nickname")%></span>
                    <input name="objectId" style="visibility:hidden" value="<%=recommendUser.get("user").id%>"/>
                  </div>

                  <div class="form-group">
                      <label>用户图片:</label>
                      <input type="file" name="recommendUserImg">
                  </div>

                  <button class="btn btn-success" id="saveUser" type="submit"><i class="glyphicon glyphicon-shopping-cart"></i>保存</button>
                </form>
              </div>

            </div>
          </div>
        </div>
      </div>

    </div>

    <% include ../partials/footer %>
  </div>
  <% include ../partials/external %>
</body>
</html>
